CREATE TABLE [dbo].[KpiHistoryItem]
(
[Oid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[KpiInstance] [uniqueidentifier] NULL,
[RangeStart] [datetime] NULL,
[RangeEnd] [datetime] NULL,
[Value] [float] NULL,
[OptimisticLockField] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[KpiHistoryItem] ADD CONSTRAINT [PK_KpiHistoryItem] PRIMARY KEY CLUSTERED  ([Oid]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [iKpiInstance_KpiHistoryItem] ON [dbo].[KpiHistoryItem] ([KpiInstance]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[KpiHistoryItem] WITH NOCHECK ADD CONSTRAINT [FK_KpiHistoryItem_KpiInstance] FOREIGN KEY ([KpiInstance]) REFERENCES [dbo].[KpiInstance] ([Oid]) NOT FOR REPLICATION
GO
